home *** CD-ROM | disk | FTP | other *** search
/ PC Answers 1998 January / PC Answers Issue 49 Cover CD January 1998.iso / Apps / Director / DATA.Z / Widget Wizard.dir / WidgtBehaviors_36_Sound Play Castmember.ls < prev    next >
Encoding:
Text File  |  1997-05-10  |  1.4 KB  |  57 lines

  1. property whichevent, WhichSound, WhichChannel, StartImmediately, tester
  2.  
  3. on triggerPlayMember me
  4.   trigger(me)
  5. end
  6.  
  7. on mouseUp me
  8.   if whichevent = #mouseUp then
  9.     trigger(me)
  10.   end if
  11. end
  12.  
  13. on mouseDown me
  14.   if whichevent = #mouseDown then
  15.     trigger(me)
  16.   end if
  17. end
  18.  
  19. on prepareFrame me
  20.   if whichevent = #prepareFrame then
  21.     trigger(me)
  22.   end if
  23. end
  24.  
  25. on enterFrame me
  26.   if whichevent = #enterFrame then
  27.     trigger(me)
  28.   end if
  29. end
  30.  
  31. on exitFrame me
  32.   if whichevent = #exitFrame then
  33.     trigger(me)
  34.   end if
  35. end
  36.  
  37. on trigger me
  38.   puppetSound(the WhichChannel of me, the WhichSound of me)
  39.   if the StartImmediately of me then
  40.     updateStage()
  41.   end if
  42. end
  43.  
  44. on getPropertyDescriptionList
  45.   set p_list to [#WhichSound: [#comment: "Sound:", #format: #string, #default: EMPTY], #WhichChannel: [#comment: "Channel:", #format: #integer, #default: 1], #whichevent: [#comment: "Triggering Event:", #format: #symbol, #range: [#mouseUp, #mouseDown, #prepareFrame, #enterFrame, #exitFrame], #default: #mouseUp]]
  46.   return p_list
  47. end
  48.  
  49. on getBehaviorDescription
  50.   return "Play the designated Sound castmember when the specified Event occurs." & RETURN & "PARAMETERS:" & RETURN & "ΓÇó Sound - number of castmember to be played." & RETURN & "ΓÇó Channel - number ( 1-4 ) of sound channel to be used for playback." & RETURN & "ΓÇó Triggering Event - event that will cause sound to play."
  51. end
  52.  
  53. on getAssocMembers
  54.   set myPropList to [WhichSound]
  55.   return myPropList
  56. end
  57.